Get Transactions by Reference Number
The 'Get Transactions by Reference Number' API enables to retrieve the details of specific transaction using the reference number of transaction
Method: POST
{{URL}}/rpc/TransactionService/GetTransactionsByRef
Headers
Name | Value |
---|---|
Content-Type | application/json |
Example
Payload Parameters
Parameter | Description |
---|---|
method Mandatory | String API method that is being called to get transaction details through ledger service Constant value – "TransactionService.GetTransactionsByRef" |
id Mandatory | String Unique ID of API request Sample value – "1" |
params Mandatory | Object |
api Mandatory | Object |
signature Mandatory | String Signature for request validation Sample value – "signature" |
keyId Mandatory | String API key used for request authentication Sample value – "ApplicationKeyId" |
credential Mandatory | String API credential provided by NetXD Sample value – "Credential" |
payload Mandatory | Object |
ReferenceId Mandatory | String Unique reference ID of the transaction Sample value – "10000000272005" |
- cURL
- C#
- Go
- NodeJS
curl --location --globoff '{{URL}}/jsonrpc' \
--header 'Content-Type: application/json' \
--data '{"method":"TransactionService.GetTransactionsByRef","id":"1","params":{"api":{"signature":"{{signature}}","keyId":"{{ApplicationKeyId}}","credential":"{{Credential}}"},"payload":{"ReferenceId":"10000000272005"}}}'
var options = new RestClientOptions("{{URL}}/jsonrpc")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
var body = @"{
" + "\n" +
@" ""method"": ""TransactionService.GetTransactionsByRef"",
" + "\n" +
@" ""id"": ""1"",
" + "\n" +
@" ""params"": {
" + "\n" +
@" ""api"": {
" + "\n" +
@" ""signature"": ""{{signature}}"",
" + "\n" +
@" ""keyId"": ""{{ApplicationKeyId}}"",
" + "\n" +
@" ""credential"": ""{{Credential}}""
" + "\n" +
@" },
" + "\n" +
@" ""payload"": {
" + "\n" +
@" ""ReferenceId"": ""10000000272005""
" + "\n" +
@" }
" + "\n" +
@" }
" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "{{URL}}/jsonrpc"
method := "POST"
payload := strings.NewReader(`{`+"
"+`
"method": "TransactionService.GetTransactionsByRef",`+"
"+`
"id": "1",`+"
"+`
"params": {`+"
"+`
"api": {`+"
"+`
"signature": "{{signature}}",`+"
"+`
"keyId": "{{ApplicationKeyId}}",`+"
"+`
"credential": "{{Credential}}"`+"
"+`
},`+"
"+`
"payload": {`+"
"+`
"ReferenceId": "10000000272005"`+"
"+`
}`+"
"+`
}`+"
"+`
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': '{{URL}}',
'path': '/jsonrpc',
'headers': {
'Content-Type': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"method": "TransactionService.GetTransactionsByRef",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"ReferenceId": "10000000272005"
}
}
});
req.write(postData);
req.end();
Body
{
"method": "TransactionService.GetTransactionsByRef",
"id": "1",
"params": {
"api": {
"signature": "{{signature}}",
"keyId": "{{ApplicationKeyId}}",
"credential": "{{Credential}}"
},
"payload": {
"ReferenceId": "10000000272005"
}
}
}
Response: 200
Response Parameters
Parameter | Description |
---|---|
id | String Unique ID of API request Sample value – "1" |
result | Object |
type | Enum Type of transaction Valid values:
Sample value – "DEPOSIT" |
mode | Enum Mode of transfer Valid values:
Sample value – "PG" |
Status | Enum Status of the transaction Valid values:
Sample value – "PENDING" |
ReferenceId | String Unique reference ID of the transaction Sample value – "REF0000000002" |
CustomerId | String Unique ID of the customer Sample value – "123465789" |
TimeStamp | String Date and time of transaction is initiated Sample value – "2020-04-22T07:44:55-05:00" |
TransactionId | String Unique transaction identification number Sample value – "5ea0164ed6571f12242d575c" |
credit | Boolean Indicates whether the transaction type is a credit transaction Sample value – false |
InstructedAmount | Object |
Amount | Number Amount of the transaction Sample value – 7 |
Currency | String Type of currency used for transaction Sample value – "USD" |
Fees | Array |
Amount | Number Fee amount for the given instructed amount Sample value – 2 |
Currency | String Currency type of fee amount Sample value – "USD" |
TransactionNumber | Number Unique transaction number that is assigned for the transaction Sample value – "QA00000000000362" |
Tax | String Tax amount Sample value – 500 |
DebtorAccount | Object |
AccountNumber | String Account number of debtor Sample value – "98652221851" |
InstitutionId | String Financial institution or bank's Id of debtor Sample value – "101115302" |
Reference | String Unique reference ID of the transaction Sample value – "txn000013" |
Party | Object |
AccountVerificationId | String Debtor's unique id for the individual Account verification Sample value – "5e9f246bd6571f2280d3d7b4" |
KycId | String Debtor's unique id for the individual KYC check Sample value – "5e9f1696d6571f272c5bcc0f" |
IdentificationType | Enum Identification type of debtor account Valid values:
Sample value – "SAVINGS" |
CreditorAccount | Object |
AccountNumber | String Account number of creditor Sample value – "9865321478" |
InstitutionId | String Financial institution or bank's Id of creditor Sample value – "011000028" |
IdentificationType | Enum Identification type of creditor account Valid values:
Sample value – "SAVINGS" |
CardNumber | String Creditor card number Sample value – "5102589999999913" |
Reference | String Unique reference ID of the transaction Sample value – "txn000013" |
ExpiryDate | String Card expiry year and month Sample value – "2022-12" |
Party | Object |
Name | String Full name of creditor Sample value – "John Deo" |
Identification | String Value of identification type Sample value – "859630248" |
IdentificationType | Enum Identification type of creditor Valid values:
Sample value – "SSN" |
DateOfBirth | String Date of birth of creditor Sample value – "19930222" |
Address | Object |
Line1 | String First line of creditor address Sample value – "1200 street" |
Line2 | String Second line of creditor address Sample value – "2nd main road" |
TownName | String City of creditor address Sample value – "chennai" |
PostCode | String ZIP Code of creditor address Sample value – "600042" |
State | String State of creditor address Sample value – "TN" |
Country | String Country of creditor address Sample value – "IN" |
{
"id": "1",
"result": {
"type": "DEPOSIT",
"mode": "PG",
"Status": "PENDING",
"ReferenceId": "REF0000000002",
"CustomerId": "123465789",
"TimeStamp": "2020-04-22T07:44:55-05:00",
"TransactionId": "5ea0164ed6571f12242d575c",
"credit": false,
"InstructedAmount": {
"Amount": 7,
"Currency": "USD"
},
"Fees": [
{
"Amount": 2,
"Currency": "USD",
"TransactionNumber": "QA00000000000362",
"Tax": 500
}
],
"DebtorAccount": {
"AccountNumber": "98652221851",
"InstitutionId": "101115302",
"Reference": "txn000013",
"Party": {
"AccountVerificationId": "5e9f246bd6571f2280d3d7b4",
"KycId": "5e9f1696d6571f272c5bcc0f"
},
"IdentificationType": "SAVINGS"
},
"CreditorAccount": {
"AccountNumber": "9865321478",
"InstitutionId": "011000028",
"IdentificationType": "SAVINGS",
"CardNumber": "5102589999999913",
"Reference": "txn000013",
"ExpiryDate": "2022-12",
"Party": {
"Name": "John Deo",
"Identification": "859630248",
"IdentificationType": "SSN",
"DateOfBirth": "19930222",
"Address": {
"Line1": "1200 street",
"Line2": "2nd main road",
"TownName": "chennai",
"PostCode": "600042",
"State": "TN",
"Country": "IN"
}
}
}
}
}